package gov.dhs.cis.soa.data;

import gov.dhs.cis.soa.Constants;
import gov.dhs.cis.soa.Utils;
import gov.dhs.cis.soa.Constants.EntityType;

import java.sql.Timestamp;


public class IntegrationSW extends AbstractSOAData {
	public static final String STEREO_TYPE = "Software Package";

	public static final String INT_TYPE = "Integrated";
	public static final String BUILD_TYPE = "Build";
	
	public int id;
	public String name;
	public transient String supported;
	public transient String descTxt;
	public String disposition;
	public String swVendor;
	public String os;
	public String version;
	public String release;
	public transient String designAspects;
	public boolean prodConfig;
	public transient Timestamp createdDt = new Timestamp(System.currentTimeMillis());

	public Description desc;

	@Override
	public String toString() {
		String ret = "IntegrationSW [id=" + id + ", name=" + name + ", Desc = " + desc + "] ";
		return ret;
	}

	public void createDescription() {
		StringBuffer txt = new StringBuffer();
		if(Utils.isEmpty(supported))
			supported = "";
		txt.append(Constants.NL+"Supports = " + supported);
		if(Utils.isEmpty(descTxt))
			descTxt = "";
		txt.append(Constants.NL+"Description = " + descTxt);
		if(Utils.isEmpty(designAspects))
			designAspects = "";
		txt.append(Constants.NL+"Design Aspects = " + designAspects);
		
		desc = Utils.prepareDescObj(txt.toString(), EntityType.INTSW);
	}
	
//	public static String getUMLId(int entityId) {
//		return EntityType.INTSW + "_" + entityId;
//	}
	
	@Override
	public long getId() {
		return id;
	}
	@Override
	public String getHashableId() {
		return name;
	}

	@Override
	public EntityType getUMLType() {
		return EntityType.INTSW;
	}
}

